function myAddEvent(obj, ev, fn) {
  if (obj.attachEvent) {
    return obj.attachEvent('on' + ev, fn);
  } else {
    return obj.addEventListener(ev, fn, false);
  }
}
